﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Utils.Exceptions;


namespace Utils.Web
{
    public class PageWithDDlAndId : System.Web.UI.Page
    {
        protected Guid ControlId
        {
            get
            {
                if (ViewState["ControlId"] != null)
                    return (Guid)ViewState["ControlId"];
                else
                    throw new ValueNotAvailableException();
            }
            set { ViewState["ControlId"] = value; }
        }

        protected String SelectedControlName
        {
            get
            {
                if (ViewState["SelectedControlName"] != null)
                    return (String)ViewState["SelectedControlName"];
                else
                    return null;
            }
            set { ViewState["SelectedControlName"] = value; }
        }
    }
}
